<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2020-06-29
 * Time: 15:53
 */

namespace app\api\model;


use think\model\concern\SoftDelete;

class GoodsOrder extends BaseModel
{
    use SoftDelete;

    public function content()
    {
        return $this->hasMany('GoodsOrderContent','order_id','id')->order('id desc');
    }

    public function user()
    {
        return $this->belongsTo('User','user_id');
    }

    public function getPayTimeAttr($value)
    {
        if($value) {
            return date('Y-m-d H:i:s',$value);
        } else {
            return '';
        }
    }
}